package com.cyj.springbootservice.controller.curl;

import com.cyj.springbootservice.api.entity.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.HashMap;

/**
 * @description:
 * @Author C_Y_J
 * @create 2022/6/15 11:47
 **/
@RestController
@RequestMapping("/curl")
public class CurlController {

    @PostMapping("/basic")
    public void basic(@RequestParam HashMap map) {
        System.out.println(map);
    }

    @PostMapping("/json")
    public void json(@RequestBody User user) {
        System.out.println(user);
    }

    @PostMapping("/upload")
    public void upload(@RequestParam("file") MultipartFile file) {
        System.out.println(file.getName() + "==文件大小：" + file.getSize());
    }
}
